<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{$title}</title>
	{load href="/static/index/css/bootstrap.min.css"}
	{css href="/static/index/css/register.css"}
	{css href="/static/index/css/m-footer.css"}
</head>


<!-- saved from url=(0091)https://passport.tujia.com/PortalSite/Register/#prevId=a25e5ac2-b319-9b8a-d94d-2f80b9fba976 -->


<body style="background-image: url('/static/index/images/body01.jpg');">
<div class="container-fluid">
	<div class="wrap-large">
		<div class="back-home">
			<a href="{:url('index/index/index')}" class="link-btn">返回首页</a>
		</div>
		<div class="hd-box">
			<h1 class="site-logo"></h1>
		</div>
				<div class="row">
					<div class="col-md-5"></div>
				<div class="login-btn-tabs login-btn-tabs-type">
					<a href="javascript:void(0)" class="active">普通用户注册</a>|<a href="javascript:void(0)" class="">手机号注册</a>

				</div>
				</div>

				<div class="tab_box">
				<!--普通用户注册-->
					<div class="row">
						<div class="col-md-5"></div>
						<div class="col-md-7">

						<form class="form-horizontal"name="regForm"  id="registerForm" data-toggle="validator" action="{:url('index/Reg/save')}" autocomplete="off" onsubmit="return checkForm()" method="post">
							<input data-val="true" data-val-required="IsEnterpriceRegister 字段是必需的。" id="isEnterpriceRegister" name="isEnterpriceRegister" type="hidden" value="False" />
							<input id="source" name="source" type="hidden" value="" />
							<input type="hidden" name="_method" value="PUT">
							<input type="hidden" name="id" value="">
							<div class="form-group">

								<div class="col-md-4 col-sm-10">
									<input type="text" class="form-control" value="" maxlengt="11" id="mobile" name="user" onblur="checkUser()" placeholder="用户名">
									<span id="utab"></span>
								</div>
							</div>
							<div class="form-group">

								<div class="col-md-4 col-sm-10">
									<input type="password" class="form-control" id="password" name="pass" placeholder="密码" onblur="checkPass()">
									<sapn id="ptab"></sapn>
								</div>
							</div>
							<div class="form-group">
								<div class="col-md-4 col-sm-10">
									<input type="password" class="form-control" id="password" name="repass" placeholder="确认密码" onblur="checkRepass()">
									<sapn id="rptab"></sapn>
								</div>
							</div>
							<div class="form-group">

								<div class="col-md-4 col-sm-10">
									<input type="email" class="form-control" id="email" name="email" onblur="checkEmail()" placeholder="邮箱">
									<sapn id="etab"></sapn>
								</div>
							</div>
							<div class="form-group">

								<div class="col-md-3 col-sm-10">
									<input class="form-control" id="inputVerify" name="verify" placeholder="验证码" type="text"
										   data-error="验证码错误" required><br>
									<div><img id="verify_img" src="{:captcha_src()}" alt="验证码" onclick="refreshVerify()">
										<a href="javascript:refreshVerify()">点击刷新</a></div>
								</div>
							</div>

							<div class="form-group">
								<div class="col-md-2 col-sm-10">
									<div class="checkbox">
										<label>
											<input type="checkbox"> 记住我
										</label>
									</div>
								</div>
							</div>
							<div class="form-group">
								<div class="col-md-2 col-sm-10">
									<button type="submit" class="btn btn-default" id="registerSumbit">注册</button>
								</div>
							</div>
						</form>
						</div>
					</div>

				<!--手机号注册-->
					<div class="row" style="display:none;">
						<div class="col-md-5"></div>
						<div class="col-md-7">

							<form class="form-horizontal"name="regForm1"  id="registerForm" data-toggle="validator" action="{:url('index/Reg/doreg')}" autocomplete="off" onsubmit="return checkForm1()" method="post">
								<input data-val="true" data-val-required="IsEnterpriceRegister 字段是必需的。" id="isEnterpriceRegister" name="isEnterpriceRegister" type="hidden" value="False" />
								<input id="source" name="source" type="hidden" value="" />
								<input type="hidden" name="_method" value="PUT">
								<input type="hidden" name="id" value="">
								<div class="form-group">

									<div class="col-md-4 col-sm-10">
										<input type="tel" class="form-control" value="" maxlength="11" id="phone" name="user_phone" onblur="checkTel1()" placeholder="手机号">
										<span id="utab1"></span>
									</div>
								</div>
								<div class="form-group">

									<div class="col-md-3 col-sm-10">


										<input type="tel" name="code" class="form-control" id="code" placeholder="请输入验证码">
										<a class="btn" href="javascript:void(0);"  id="send_sms">
											获取验证码</a>
										<span id="smsMess"></span>
									</div>
								</div>
								<div class="form-group">

									<div class="col-md-4 col-sm-10">
										<input type="password" class="form-control" id="password" name="pass1" placeholder="密码" onblur="checkPass1()">
										<sapn id="ptab1"></sapn>
									</div>
								</div>
								<div class="form-group">

									<div class="col-md-4 col-sm-10">
										<input type="password" class="form-control" id="password" name="repass1" placeholder="确认密码" onblur="checkRepass1()">
										<sapn id="rptab1"></sapn>
									</div>
								</div>



								<div class="form-group">
									<div class="col-md-2 col-sm-10">
										<div class="checkbox">
											<label>
												<input type="checkbox"> 记住我
											</label>
										</div>
									</div>
								</div>
								<div class="form-group">
									<div class="col-md-2 col-sm-10">
										<button type="submit" class="btn btn-default" id="registerSumbit">注册</button>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>

 	</div>
</div>

<div id="footer" class="footer-wrap" style="margin: 0; margin-top: 15px; position: absolute; top: 900px; width: 100%;">
	<div class="m-footer-link-list" style="border:0; background-color: transparent">
		<a href="http://content.tujia.com/tujiajianjie.htm" target="_blank" class="forst" rel="nofollow">关于我们</a>|
		<a href="http://content.tujia.com/youkebangzhu.htm" target="_blank" rel="nofollow">我是房客</a>|
		<a href="http://content.tujia.com/qiyewenhua.htm" target="_blank" rel="nofollow">加入途家</a>|


		<a href="https://www.tujia.com/sitemap.htm" target="_blank">网站地图</a>
	</div>

	<div id="copyright" class="copyright-cont" style="border:0; padding:0; margin-top:3px;">
		<p style="margin:0;">© Copyright 2017 tujia.com 途家版权所有<span><a href="http://www.miitbeian.gov.cn/" target="_blank" rel="nofollow">京ICP证120277号</a></span> <span style="display: inline-block; margin-left: 10px">京公网安备11010502027120</span></p>
		<p class="safe-cont">
			<a href="http://www.12377.cn/" target="_blank" rel="nofollow">
				<img src="/static/index/images/safe-img1.jpg" alt="互联网违法和不良信息举报中心" width="138" height="40">
			</a>
			<a href="http://bj.cyberpolice.cn/" target="_blank" rel="nofollow">
				<img src="/static/index/images/safe-img3.jpg" alt="北京市公安局网络违法犯罪举报" width="98" height="40">
			</a>
			<a href="http://www.itrust.org.cn/home/index/itrust_certifi/wm/PJ2017011301.html" target="_blank" rel="nofollow">
				<img src="/static/index/images/net-img1.jpg" alt="企业信用评级" width="113" height="40">
			</a>
		</p>
	</div>
</div>

{js href="/static/index/js/jquery.min.js"}
{js href="/static/index/js/bootstrap.min.js"}
{js href="/static/index/js/validator.js"}



<!--js实现用户注册各种验证-->
<script>
    function checkEmail(){
        var email = document.regForm.email.value;
        var etab =document.getElementById('etab');
        if (email.match(/^[\w-]+@[\w-]+(\.\w+){1,3}$/) == null){
            etab.innerHTML = '请输入正确的邮箱';
            etab.style.color ='#f00';
            return false;
        }else{
            etab.innerHTML = '正确';
            etab.style.color ='#0a0';
            return true;
        }
    }

    function checkUser(){
        var user = document.regForm.user.value;
        var utab =document.getElementById('utab');
        if (user.match(/^[\u0391-\uFFE5]+$/) == null){
            utab.innerHTML = '请输入正确的用户名';
            utab.style.color ='#f00';
            return false;
        }else{
            utab.innerHTML = '正确';
            utab.style.color ='#0a0';
            return true;
        }
    }
    function checkPass(){
        var pass = document.regForm.pass.value;
        var ptab =document.getElementById('ptab');
        if (pass.length<6||pass.length>18){
            ptab.innerHTML = '请输入正确的密码';
            ptab.style.color ='#f00';
            return false;
        }else{
            ptab.innerHTML = '正确';
            ptab.style.color ='#0a0';
            return true;
        }
    }

    function checkRepass(){
        var repass = document.regForm.repass.value;
        var pass = document.regForm.pass.value;
        var retab =document.getElementById('rptab');

        if (pass !==repass){
            retab.innerHTML = '请输入正确的密码';
            retab.style.color ='#f00';
            return false;
        }else{
            retab.innerHTML = '正确';
            retab.style.color ='#0a0';
            return true;
        }
    }

    function checkForm(){
        return checkEmail() && checkUser() && checkPass() && checkRepass();
    }
</script>

<!--js实现手机注册各种验证-->
<script>
    function checkTel1(){
        var tel = document.regForm1.user_phone.value;
        var utab1 =document.getElementById('utab1');
        if (tel.match(/^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/) == null){
            utab1.innerHTML = '请输入正确的手机号';
            utab1.style.color ='#f00';
            return false;
        }else{
            utab1.innerHTML = '正确';
            utab1.style.color ='#0a0';
            return true;
        }
    }

    function checkPass1(){
        var pass = document.regForm1.pass1.value;
        var ptab1 =document.getElementById('ptab1');
        if (pass.length<6||pass.length>18){
            ptab1.innerHTML = '请输入正确的密码';
            ptab1.style.color ='#f00';
            return false;
        }else{
            ptab1.innerHTML = '正确';
            ptab1.style.color ='#0a0';
            return true;
        }
    }

    function checkRepass1(){
        var repass1 = document.regForm1.repass1.value;
        var pass1 = document.regForm1.pass1.value;
        var retab1 =document.getElementById('rptab1');

        if (pass1 !==repass1){
            retab1.innerHTML = '请输入正确的密码';
            retab1.style.color ='#f00';
            return false;
        }else{
            retab1.innerHTML = '正确';
            retab1.style.color ='#0a0';
            return true;
        }
    }
    function checkForm1(){
        return checkPass1() && checkRepass1() && checkTle1();
    }
</script>


<!--实现手机获取验证码-->
<script>
	$(function(){
	  $('#send_sms').click(function (){
	      var phone = $("#phone").val();
	      $.ajax({
	         //路由
			  url:'/sendSms',
			  type : 'get',
			  data : {'phone':phone},
              dataType:'json',
              success:function(data){
				 var data = JSON.parse(data);

				if (data.status == 0){
				    $('#smsMess').html(data.message).css('color', 'green');
			     }else{
				    $('#smsMess').html(data.message).css('color', 'red');
				}

			  }
		  });
	  });

	});
</script>


<!--用户验证码验证规则-->
	<script>
        function refreshVerify() {
            var ts = Date.parse(new Date())/1000;
            $('#verify_img').attr("src", "/captcha?id="+ts);
        }
	</script>

<!--jquery实现手机页面和用户注册切换-->
<script>
    $(function(){
        $(".login-btn-tabs a").click(function(){
            $(this).addClass("active").siblings().removeClass("active"); //切换选中的按钮高亮状态
            var index=$(this).index(); //获取被按下按钮的索引值，需要注意index是从0开始的
            $(".tab_box > div").eq(index).show().siblings().hide(); //在按钮选中时在下面显示相应的内容，同时隐藏不需要的框架内容
        });
    });
</script>








</body>
</html>